<template>
  <div>
    <div>账号切换</div>
    <button @click="zhangsan()" type="default" size="mini">张三</button>
    <button @click="lisi()" type="default" size="mini">李四</button>
    <button @click="admin()" type="default" size="mini">admin</button>
    <div>当前token：{{ token }}</div>
  </div>
</template>

<script>
export default {
  name: "Test",

  data() {
    return {
      token: ''
    };
  },

  created(){
    this.token = window.localStorage.getItem('token')
  },

  methods: {
    admin() {
      window.localStorage.setItem('token', '');
      let token = 'eyJhbGciOiJIUzUxMiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAAAKtWKi5NUrJScgwN8dANDXYNUtJRSq0oULIyNDe0sDQ1sTCy1FEqLU4t8kwBikGYeYm5qUAtiSm5mXlKtQC4U0ISQgAAAA.8SgWi-fpFdxr6ILCZcMUEwAcx01oMUIFZ5oh6r_I5gYF8gwqV0gtrbPuyV-LLtnet-SvDyzC7u1EzZdwfDmg9A'
      window.localStorage.setItem('token', token);
      this.token = window.localStorage.getItem('token')
    },

    zhangsan() {
      window.localStorage.setItem('token', '');
      let token = 'eyJhbGciOiJIUzUxMiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAAAKtWKi5NUrJScgwN8dANDXYNUtJRSq0oULIyNDe0sDQ1NTA10FEqLU4t8kxRsjIxhLDzEnNTgXqqMhLz0osT85RqAec9mK5GAAAA.WnB5O-hx_P-vY3cex0HzEx6ZnRszNAAYpW35wWKXQWtBo737ARqZgFovXdBK08uWl1BizS2mLZB67hZA_6XTGw'
      window.localStorage.setItem('token', token);
      this.token = window.localStorage.getItem('token')
    },

    lisi() {
      window.localStorage.setItem('token', '');
      let token = 'eyJhbGciOiJIUzUxMiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAAAKtWKi5NUrJScgwN8dANDXYNUtJRSq0oULIyNDe0sDQ1NbA00VEqLU4t8kxRsjIxgrDzEnNTgXpyMoszlWoB-h-NaEIAAAA.pTroHkNf6sExBdmANOD6tMrZZT6CSXC4JaA2tW0upMqkSDIfWo_ISqjv_fkhpbPB7Z6t3vuQR0XZwCGo86TGxg'
      window.localStorage.setItem('token', token);
      this.token = window.localStorage.getItem('token')
    }
  }
}
</script>
